//@flow  
function sum(a :number,b:number ){
    return a+b
}

sum(100,100)
// sum('100','100')

function squre(n){
   return n*n 
}
squre(100)

function foo(fe):number {
    return fe
}
foo(1002)


const a:string='fooo'
const b:number=Infinity //无穷大  (NaN  100)也可以
const c:boolean=true
const d:null=null
const e:void=undefined
const f:Symbol=Symbol()
const arr1:Array<number>=[12,2,3,4]
const arr2:number[]=[1,2,3]
const foo :[string,number] =['foo',100]
const obj :{foo:string,bar:number}={foo:'string',bar:100}
const obj2:{foo?:string,bar:number}={bar:100}
const obj3 :{[sring]:string} ={}

function foo2(clalback:(string,number)=>void ){
    clalback('string',100)
}
foo2(function(str,n){
    console.log(str,n)
})

function passMixed(value:mixed){ //强类型
    console.log(value)
}
passMixed('任意类型的参数')

function passAny(value:any){  //弱类型
    console.log(value)  
}
passAny(100)